#include <iostream>
#include <thread>
#include <unistd.h>
void start_routine()
{
    while(1)
    {
        std::cout << "我是新线程" << std::endl;
        sleep(1);
    }
}
int main()
{
    std::thread td(start_routine);
    while(1)
    {
        std::cout << "我是主线程" << std::endl;
        sleep(1);
    }
    td.join();
    return 0;
}